<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class SeedMetasData extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $areas = [
            [
                'name'        => '本市',
                'ordernum'        => 1,
            ],
            [
                'name'        => '外地',
                'ordernum'        => 2,
            ]
        ];

        DB::table('areas')->insert($areas);

        $categories = [
            [
                'name'        => '购物',
                'ordernum'        => 1,
                'description' => '购物',
            ],
            [
                'name'        => '美食',
                'ordernum'        => 2,
                'description' => '美食',
            ],
            [
                'name'        => '用品',
                'ordernum'        => 3,
                'description' => '用品',
            ],
            [
                'name'        => '酒店',
                'ordernum'        => 3,
                'description' => '酒店',
            ],
            [
                'name'        => '娱乐',
                'ordernum'        => 4,
                'description' => '娱乐',
            ],
            [
                'name'        => '旅游',
                'ordernum'        => 5,
                'description' => '旅游',
            ],
            [
                'name'        => '其他',
                'ordernum'        => 6,
                'description' => '其他',
            ],
        ];

        DB::table('categories')->insert($categories);

        $types = [
            [
                'name'        => '购物',
                'ordernum'        => 1,
                'description' => '购物',
            ],
            [
                'name'        => '美食',
                'ordernum'        => 2,
                'description' => '美食',
            ],
            [
                'name'        => '用品',
                'ordernum'        => 3,
                'description' => '用品',
            ],
            [
                'name'        => '酒店',
                'ordernum'        => 3,
                'description' => '酒店',
            ],
            [
                'name'        => '娱乐',
                'ordernum'        => 4,
                'description' => '娱乐',
            ],
            [
                'name'        => '旅游',
                'ordernum'        => 5,
                'description' => '旅游',
            ],
            [
                'name'        => '其他',
                'ordernum'        => 6,
                'description' => '其他',
            ],
        ];

        DB::table('types')->insert($types);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        DB::table('areas')->truncate();
        DB::table('categories')->truncate();
        DB::table('types')->truncate();
    }
}
